#!/bin/bash

export FLUME_HOME=/usr/local/flume
export FLUME_CONF_DIR=$FLUME_HOME/conf
export HADOOP_HOME=/usr/local/hadoop
export HIVE_HOME=/usr/local/hive
export HBASE_HOME=/usr/local/hbase
export PATH=$PATH:$HIVE_HOME/bin
export PATH=$PATH:/usr/local/hbase/bin
export PATH=$PATH:$FLUME_HOME/bin
export JAVA_HOME=/usr/lib/jdk
export PATH=$JAVA_HOME/bin/:$PATH

export HADOOP_HOME=/usr/local/hadoop
export PATH=$PATH:$HADOOP_HOME/bin

source /etc/profile

yes | cp -rf ./config/core-site.xml $HADOOP_HOME/etc/hadoop/core-site.xml
yes | cp -rf ./config/hadoop-env.sh /usr/local/hadoop/etc/hadoop/hadoop-env.sh
yes | cp -rf ./config/hdfs-site.xml $HADOOP_HOME/etc/hadoop/hdfs-site.xml 

yes | cp -rf ./config/flume-env.sh $FLUME_CONF_DIR
yes | cp -rf ./config/flume-conf.properties $FLUME_CONF_DIR
yes | cp -rf ./config/flume-to-spark.conf $FLUME_CONF_DIR

yes | cp -rf ./config/hbase-site.xml $HBASE_HOME/conf/
yes | cp -rf ./config/hbase-env.sh $HBASE_HOME/conf/

yes | cp -rf ./config/hive-site.xml /usr/local/hive/conf/

yes | cp -rf ./config/server.properties /usr/local/kafka/config

yes | cp -rf ./config/zoo.cfg /usr/local/zookeeper/conf/

yes | cp -rf ./config/spark-env.sh /usr/local/spark/conf
yes | cp -rf ./config/slaves /usr/local/spark/conf

rm -rf /opt/*
rm -rf ~/.bash_history
history -c
